package com.softer.wxzj.controller;

import com.github.pagehelper.PageInfo;
import com.softer.wxzj.common.aop.annotation.LogRecord;
import com.softer.wxzj.common.aop.enums.LogOperationType;
import com.softer.wxzj.common.aop.enums.LogOperationUnit;
import com.softer.wxzj.common.entity.Page;
import com.softer.wxzj.entity.HouseAndOwner;
import com.softer.wxzj.entity.RefReq;
import com.softer.wxzj.entity.RefReqList;
import com.softer.wxzj.service.RefReqListService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * RefReqListService class
 * @author zcz
 * @date 2019/7/10
 */
@RestController
@RequestMapping("/refReqList")
@Slf4j
public class RefReqListController {

    @Autowired
    RefReqListService refReqListService;

    @RequestMapping("/getAuditList")
    @LogRecord(description = "部分退款审批详情列表", operationUnit = LogOperationUnit.REF_REQ_LIST, operationType = LogOperationType.SELECT)
    public PageInfo<RefReqList> getAuditList(Page page, @RequestParam("id") String id) {
        return refReqListService.getAuditList(page, id);
    }
    @RequestMapping("/getBatchRefReqListDetail")
    @LogRecord(description = "批量退款明细查询", operationUnit = LogOperationUnit.REF_REQ_LIST, operationType = LogOperationType.SELECT)
    public PageInfo<RefReqList> getBatchRefReqListDetail(Page page, RefReq refReq) {
        return refReqListService.getBatchRefReqListDetail(page, refReq);
    }



    /**
     * 退款信息
     * @param houseAndOwner
     * @return
     */
    @RequestMapping("/selectOwnerByHouseId")
    @LogRecord(description = "退款信息", operationUnit = LogOperationUnit.REF_REQ_LIST, operationType = LogOperationType.SELECT)
    public PageInfo<HouseAndOwner> selectOwnerByHouseId(Page page,HouseAndOwner houseAndOwner){
     return refReqListService.selectOwnerByHouseId(page,houseAndOwner);
   }
}
